Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

147
Vistas
Remove all divs the contain "months" or "years" on the youtube homescreen

How do I with a simple a jquery string in the console remove/restyle all elements that contain the innerHTML strings "years" and "months" on the youtube homescreen?

The goal is to remove or highlight all old video containers so i don't have to look at it and can focus on the new stuff since youtube recycle their content too much.

What i have done so far:

Step 1: First load jquery (works)

var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type (or see below for non wait option)
jQuery.noConflict();

Step 2 (fails): If i use ":contains" it remove everything and if i use ":has" nothing happens. How do i get it to not remove everything but only the specefic video elements?

$( "div:has('months')" ).css( "display", "none" );

This i the jQuery documentation i was following: https://api.jquery.com/category/selectors/content-filter-selector/

If any good ideas in how to clean up this homescreen please add a suggestion. With the Chrome "Multi Search & Multi Jump" plugin you can scroll to the bottom of the feed highlight all strings but would be much nicer to remove them all.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Something like this perhaps (no need for jQuery) - tested in Chrome...

document.querySelectorAll('.ytd-video-meta-block').forEach(meta => { const metaText = meta.innerText; if(metaText.indexOf("month") !== -1 || metaText.indexOf("year") !== -1){ const old = meta.closest('.ytd-rich-grid-row'); if(old){ old.remove() }} })
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda